home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / BLAKJACK.PAK / README.TXT < prev   
Text File  |  1997-05-06  |  4KB  |  119 lines

  1. Copyright Borland International
  2. ObjectWindows (C) 1995
  3.  
  4. Title: BLAKJACK Example
  5.  
  6. Keywords: Game;Blackjack
  7.  
  8. This is a subset of a standard blackjack game. It uses a card VBX control
  9. to display the cards.
  10.  
  11.  
  12. [Objective]
  13.  
  14. One player and one dealer can play this game.
  15.  
  16. The player enters amount of money using the "Bankroll" button at the
  17. begining of the game. After entering the bankroll amount, the player can
  18. go on pressing "Hit" button until the score is near 21. If the player
  19. scores more than 21, he looses. The trick is to hit "Stand" button when
  20. the score is near 21. After you loose or win, you can bet again using the
  21. "Bet" button. Player plays the game until the bankroll is exhausted, at
  22. that time he can input more money in bankroll.
  23.  
  24.  
  25. [Buttons And Their Explanation]
  26.  
  27.  
  28. [Bankroll]
  29.  
  30. Hit this button and enter the amount you want to play (Max 9999)
  31.  
  32.  
  33. [Bet]
  34.  
  35. Hit this button when you want to bet part of the money from
  36. bankroll. No letters, negative numbers are allowed in the input dialog, it
  37. will not accept the input at all.
  38.  
  39.  
  40. [Play]
  41.  
  42. After you hit the bet button it toggles to a 'Play' button. Pressing this
  43. button starts the game. At start, immediately after betting, the player and
  44. the dealer are issued 2 cards. If any one of these hand add up to 21 the
  45. party wins immediately. If both are 21, the game is draw. Dealer shows only
  46. one card face up all the time, along with the points.
  47.  
  48.  
  49. [Hit]
  50.  
  51. Player receives one card from dealer when he hits this button. The issued
  52. card is immediately displayed with the new total points. At this point
  53. dealer may choose a card if his total point is less than 17, which is not
  54. displayed as usual (dealers algorithm to hit a card).
  55.  
  56.  
  57. [Stand]
  58.  
  59. This button is hit when the player no longer wishes to play. At this point
  60. dealer may deal a card to himself if his points are less than 17. At the
  61. end dealers hand is displayed and the scores are announced.
  62.  
  63.  
  64. [Help]
  65.  
  66. Shows help|About dialog.
  67.  
  68.  
  69.  
  70.  
  71. [Design Overview]
  72.  
  73. First the Bankroll is entered by the user and stored in the "Bankroll"
  74. class. The increment and decrement of the bankroll is done by the
  75. member funtions in that class.
  76.  
  77.  
  78. 52 cards are "new"-ed  of type "TVbxMhCardDeck" and stored in  the
  79. array "TBlackjack::ppVBXCard[]" in the constructor of
  80. "TBlackjack" class.
  81. "TVbxMhCardDeck" type of cards are VBX controls.
  82. The "Card" object stores only the Suit and Number information.
  83. ("Card" object is defined in blakjack.h)
  84.  
  85.  
  86. When a "Card" is displayed the Suit and Number informations are
  87. taken from the "Card" object, the displayable VBX card is taken from
  88. "TBlackjack::ppVBXCard[VBXCardCount]" array. Each VBX card can have 52
  89. possible values. The VBX card is displayed according to the
  90. above Suit and Number information.
  91.  
  92.  
  93. "TBlackjack::VBXCardCount", points to the next VBX card in the
  94. "TBlackjack::ppVBXCard[]" array which is available.
  95. eg: Count 12 means, cards from ppVBXCard[0] through ppVBXCard[11]
  96. have already been dealt and displayed, and ppVBXCard[12] is
  97. the next VBX card available.
  98.  
  99.  
  100. Suffling and dealing are done using "Card" and "Deck"
  101. objects. "TBlackjack::ppVBXCard[]" array only holds the
  102. displayable VBX cards. Each "Card" object stores an
  103. array index of the "TBlackjack::ppVBXCard[]" array in "Card::pVBXCard"
  104. data member.
  105. The VBX card at this index( in "TBlackjack::ppVBXCard[]" array)
  106. is used to display that particular "Card" object.
  107. This keeps the engine and UI part seperate.
  108.  
  109.  
  110. Dealer is assumed to have infinite amount of money.
  111.  
  112.  
  113. The cards in a particular suit are numbered from 0 - 12
  114. eg: Ace->0, Two->1..., Jack->10, King->11, Queen->12
  115. These numbers have nothing to do with the actual blackjack
  116. points, it is used only to keep track of the cards.
  117.  
  118.  
  119.